package com.itheima.dao;

import com.itheima.domain.Student;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

public class ReadStudent {


    public static ArrayList<Student> lookStudent() throws IOException {
        ArrayList<Student> list = new ArrayList<>();
        FileReader fileReader = new FileReader("D:\\软件\\桌面\\aaa.txt");
        BufferedReader bufferedReader = new BufferedReader(fileReader);
        String len;
        while ((len=bufferedReader.readLine())!=null){
            String[] split = len.split(",");
            Student student= new Student(split[0],split[1],split[2]);
            list.add(student);
        }
        return list;
    }
}
